﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="Control_Employees_WebUserControl" %>


<script language="javascript">

function confirmMsg(frm){
    for(i=0; i<frm.length; i++){
        if(frm.elements[i].name.indexOf('deleteRec') != -1){
            if(frm.elements[i].checked)
            return confirm ('Are you sure you want to delete your selection(s)?');
        }
    }
}
</script>

<p style="text-align: center">
    <br />
    EMPLOYEES</p>
<asp:GridView ID="grvShow" runat="server" DataKeyNames="EMP_ID" 
    style="text-align: center" GridLines="Horizontal" 
    AutoGenerateColumns="False" >
    <Columns>
        <asp:TemplateField HeaderText="Select">
        <ItemTemplate >           
            <asp:CheckBox ID="chkSelect" runat = "server" />
        </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="EMP_FIRSTNAME" HeaderText="Name" />
        <asp:BoundField DataField="EMP_ADDRESS" HeaderText="Address" />
        <asp:BoundField DataField="EMP_PHONE" HeaderText="Phone" />
        <asp:BoundField DataField="EMP_STARTDATE" HeaderText="Date Start" />
        
        <asp:BoundField DataField="EMP_LICENSE" HeaderText="License #" />
        <asp:BoundField DataField="EMP_POSITION" HeaderText="Position" />
        
         <asp:TemplateField HeaderText="Edit">
              <ItemTemplate>
                   <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("EMP_ID", "../../Edit_Employee.aspx?EMP_ID={0}") %>'
                            Text="Edit" HeaderText="Edit"></asp:HyperLink>
              </ItemTemplate>
         </asp:TemplateField>

            
    </Columns>
</asp:GridView>
<asp:Button ID="btnAdd" runat="server" style="text-align: center" Text="Add" 
    PostBackUrl="~/Add_Employee.aspx" />
&nbsp;<asp:Button ID="btnDelete" OnClientClick="return confirmMsg(this.form)" 
    runat="server" Text="Delete" 
    onclick="DeleteBtn_Click" />






